<?php

class NewsController extends Controller
{
	
	public $layout='//layouts/view';
	
	public function actionIndex()
	{
		$this->render('news');
	}
	
	public function actionDetail($id)
	{
		$data =  new CActiveDataProvider('News', array(
			'criteria'=>array(
				'condition'=>''
			),
			'pagination'=>array(
				'pageSize'=>1
			)
		));
		$this->render('detail', array(
			'news'=>$data
		));
	}
	
	public function getNews($page)
	{
		return new CActiveDataProvider('News', array(
			'criteria'=>array(
				'condition'=>''
			),
			'pagination'=>array(
				'pageSize'=>10,
				'currentPage'=>($page-1)
			)
		));
	}
}